package org.xhs.geomap.net
{
	import com.mapabc.maps.api.basetypes.MLngLat;
	import com.mapabc.maps.api.basetypes.MLngLatBounds;
	import com.mapabc.maps.api.overlays.MPolyline;
	import com.mapabc.maps.api.overlays.options.MLineOptions;
	import com.mapabc.maps.api.styles.MLineStyle;
	
	import org.xhs.geomap.net.BlockPolygon;

	public class BlockDataModel
	{
		private var _bCode:String;
		private var _bName:String;
		private var _bXFPrice:Number;
		private var _bESFPrice:Number;
		private var _bZLPrice:Number;
		private var _bLnglatsArray:Array;
		private var _bCentLnglat:MLngLat;
		private var _bBoundsLnglat:MLngLatBounds;
		
		public function BlockDataModel(code:String, name:String, lnglatsArray:Array, centLnglat:MLngLat, boundsLnglat:MLngLatBounds) 
		{			
			bCode = code;
			bName = name;
			bXFPrice = 0;
			bESFPrice = 0;
			bZLPrice = 0;
			bLnglatsArray = lnglatsArray;
			bCentLnglat = centLnglat;
			bBoundsLnglat = boundsLnglat;
		}
		
		public function get bBoundsLnglat():MLngLatBounds
		{
			return _bBoundsLnglat;
		}

		public function set bBoundsLnglat(value:MLngLatBounds):void
		{
			_bBoundsLnglat = value;
		}

		public function get bCentLnglat():MLngLat
		{
			return _bCentLnglat;
		}

		public function set bCentLnglat(value:MLngLat):void
		{
			_bCentLnglat = value;
		}

		public function get bLnglatsArray():Array
		{
			return _bLnglatsArray;
		}

		public function set bLnglatsArray(value:Array):void
		{
			_bLnglatsArray = value;
		}

		public function get bZLPrice():Number
		{
			return _bZLPrice;
		}

		public function set bZLPrice(value:Number):void
		{
			_bZLPrice = value;
		}

		public function get bESFPrice():Number
		{
			return _bESFPrice;
		}

		public function set bESFPrice(value:Number):void
		{
			_bESFPrice = value;
		}

		public function get bXFPrice():Number
		{
			return _bXFPrice;
		}

		public function set bXFPrice(value:Number):void
		{
			_bXFPrice = value;
		}

		public function get bName():String
		{
			return _bName;
		}

		public function set bName(value:String):void
		{
			_bName = value;
		}

		public function get bCode():String
		{
			return _bCode;
		}

		public function set bCode(value:String):void
		{
			_bCode = value;
		}
		
		//返回区块多边形
		public function getBlockPolygon():BlockPolygon
		{
			var blockPolygon:BlockPolygon = new BlockPolygon(bLnglatsArray, bCentLnglat, bBoundsLnglat, bCode, bName, bXFPrice, bESFPrice, bZLPrice);
			return blockPolygon;
		}
		
		//返回区块边界
		public function getBorder():MPolyline
		{
			var mlstyle:MLineStyle = new MLineStyle();
			mlstyle.thickness = 2;
			
			var lineOptions:MLineOptions = new MLineOptions();
			lineOptions.zoomLevels = [14,15,16,17];
			lineOptions.lineStyle = mlstyle;
			var line:MPolyline = new MPolyline(bLnglatsArray, lineOptions);
			return line;	
		}
	}
}